perm filename LIFE.LSP[W82,JMC] blob sn#632547 filedate 1982-01-05 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	life.lsp[w82,jmc]	lisp program for competitive life
C00003 ENDMK
CāŠ—;
life.lsp[w82,jmc]	lisp program for competitive life

(array space fixnum 20. 20.)


MacLisp Ready
T 
SPACE 
(space 2 3)
(defun newval (x y)
       ((lambda (cc)
		((lambda (c w b)
			 (if (lessp c 2) 0
			     (greaterp c 3) 0
			     (equal c 2) (if (= 0 (space x y)) 0
					     (= b 0) 1
					     (= w 0) 2
					     (space x y))
			     (equal c 3) (if (= 0 (space x y)) (if (lessp b c) 1 2)
					     (= b 0) 1
					     (= w 0) 1
					     (space x y))))
		 (count cc) (white cc) (black cc)))
	(ccount x y)))

(defun count (cc) (car cc))
(defun white (cc) (cadr cc))
(defun black (cc) (caddr cc))